<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>

<xsl:template name="monthName">
 <xsl:param name="month"/>
 <xsl:choose>
   <xsl:when test="$month=1">Gennaio</xsl:when>
   <xsl:when test="$month=2">Febbraio</xsl:when>
   <xsl:when test="$month=3">Marzo</xsl:when>
   <xsl:when test="$month=4">Aprile</xsl:when>
   <xsl:when test="$month=5">Maggio</xsl:when>
   <xsl:when test="$month=6">Giugno</xsl:when>
   <xsl:when test="$month=7">Luglio</xsl:when>
   <xsl:when test="$month=8">Agosto</xsl:when>
   <xsl:when test="$month=9">Settembre</xsl:when>
   <xsl:when test="$month=10">Ottobre</xsl:when>
   <xsl:when test="$month=11">Novembre</xsl:when>
   <xsl:when test="$month=12">Dicembre</xsl:when>
   <xsl:otherwise>
     <xsl:value-of select="$month"/>
   </xsl:otherwise>
 </xsl:choose>
</xsl:template>

<xsl:template match="holidays">

<table class="body" border="0" cellspacing="0" cellpadding="3" width="100%">
<tr>
<td style="border-bottom: 1px dotted black;FONT-SIZE: 12pt;">Periodo</td>
<td style="border-bottom: 1px dotted black;FONT-SIZE: 12pt;">Destinazione</td>
<td style="border-bottom: 1px dotted black;FONT-SIZE: 9pt;">Partenza/Ritorno</td>
<td style="border-bottom: 1px dotted black;FONT-SIZE: 12pt;">Titolo</td>
<td style="border-bottom: 1px dotted black;FONT-SIZE: 12pt;">Si parte da</td>
</tr>
	<xsl:for-each select="holiday">
<tr><td class="body_10px" style="border-bottom: 1px dotted #666666;">
<b>
<xsl:call-template name="monthName">
<xsl:with-param name="month" select="substring(@startDate,6,2)"/>
</xsl:call-template> (<xsl:value-of select="substring(@startDate,1,4)"/>)
</b>
</td>
<td style="border-bottom: 1px dotted #666666;"><b><xsl:value-of select="@destination"/></b></td>
<td style="border-bottom: 1px dotted #666666;">
<nobr><xsl:value-of select="substring(@startDate,9,2)"/>/<xsl:value-of select="substring(@startDate,6,2)"/>/<xsl:value-of select="substring(@startDate,1,4)"/></nobr><br/>
<nobr><xsl:value-of select="substring(@endDate,9,2)"/>/<xsl:value-of select="substring(@endDate,6,2)"/>/<xsl:value-of select="substring(@endDate,1,4)"/></nobr>

</td>
<td style="border-bottom: 1px dotted #666666;"><a href="/holidays/holidayShow.aspx?holidayId={@holidayid}"><b><xsl:value-of select="@title"/></b><br/>(attualmente iscritti <xsl:value-of select="@howMany"/>)</a></td>
<td style="border-bottom: 1px dotted #666666;"><xsl:value-of select="@cityName"/></td>
</tr>
</xsl:for-each>
</table>

</xsl:template>

<xsl:template name="lf2br">
 <xsl:param name="text"/>
 <xsl:choose>
   <xsl:when test="contains($text,'&#10;')">
     <xsl:value-of select="substring-before($text,'&#10;')"/>
     <br/>
     <xsl:call-template name="lf2br">
       <xsl:with-param name="text">
         <xsl:value-of select="substring-after($text,'&#10;')"/>
       </xsl:with-param>
     </xsl:call-template>
   </xsl:when>
   <xsl:otherwise>
     <xsl:value-of select="$text"/>
   </xsl:otherwise>
 </xsl:choose>
</xsl:template>

</xsl:stylesheet>